<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Statement" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/6/11 0011
  Time: 17:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%
    Class.forName("com.mysql.jdbc.Driver");
    String url = "jdbc:mysql://localhost:3306/myschool2";
    String user = "root";
    String pwd = "root";
    Connection conn = DriverManager.getConnection(url,user,pwd);
    String ddl = "create table if not exists xueyuan2(id int primary key auto_increment,name varchar(50) not null,gender char(2),bornday datetime)";
    Statement st = conn.createStatement();
    st.execute(ddl);
    st.close();
    conn.close();

%>
<h1>xueyuan表已创建</h1>
<a href="addStudent.jsp">添加学员</a> | <a href="listStudent.jsp">查看学员</a>

</body>

</html>
